#include <stdio.h>

int my_add(int a, int b)
{
	int ret = 0;
	ret = a + b;
	return ret;
}
int my_sub(int a, int b)
{
	int ret = 0;
	ret = a - b;
	return ret;
}
int my_mul(int a, int b)
{
	int ret = 0;
	ret = a * b;
	return ret;
}
double my_div(int a, int b)
{
	double ret = 0;
	ret = (double)a / (double)b;
	return ret;
}

int main(int argc, const char *argv[])
{
	int input = 0;
	int a = 0;
	int b = 0;
	do
	{
		printf("请输入操作>1.加2.减3.乘4.除");
		scanf("%d", &input);
		if(input == 0)
		{
			break;
		}
		printf("请输入操作数1>");
		scanf("%d", &a);
		printf("请输入操作数2>");
		scanf("%d", &b);
		switch(input)
		{
		case 1:
			printf("%d\n", my_add(a,b));
			break;
		case 2:
			printf("%d\n", my_sub(a,b));
			break;
		case 3:
			printf("%d\n", my_mul(a,b));
			break;
		case 4:
			printf("%lf\n", my_div(a,b));
			break;
		case 0:
			break;
		}

	}while(input);

	return 0;
}
